// import React from "react";
import { useNavigate } from "react-router-dom";
import { useEffect } from "react";
function AuthRouter() {
  const navigate = useNavigate();
  useEffect(() => {
    if (!localStorage.getItem("user")) {
      navigate("/login");
    } else {
      navigate("/Homepage");
    }
  }, [localStorage.getItem("user")]);
}

export default AuthRouter;
